<!DOCTYPE html>
<html>
{{> head title="执行中"}}
<link rel="stylesheet" href="/static/css/running.css">
<body>
    {{> navbar}}
    <div class="container-fluid">
        <div class="split-container">
            <div class="split-pane left-pane">
                <div class="vertical-scroll-container">
                    <div class="pane-content">
                        <h3 class="text-center">运行中的工作流(workflows)</h3>
                        <div id="workflows-container">
                            <!-- 工作流列表将通过 JavaScript 动态生成 -->
                        </div>
                    </div>
                </div>
            </div>
            <div class="split-handle">
                <div class="handle-bar"></div>
            </div>
            <div class="split-pane right-pane">
                <div class="vertical-scroll-container">
                    <div class="pane-content">
                        <h3 class="text-center m-0">运行中的任务(tasks)</h3>
                        <div id="tasks-container">
                            <!-- 任务列表将通过 JavaScript 动态生成 -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <style>
        h3 {
            font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
            font-size: 20px;
            font-weight: bold;
        }
        .split-container {
            height: calc(100vh - 70px);
            margin-top: 40px;
            display: flex;
            flex-direction: row;
            border: 1px solid #dee2e6;
            border-radius: 0.25rem;
            background-color: #fff;
        }

        .split-pane {
            flex: 1;
            position: relative;
            display: flex;
            flex-direction: column;
        }

        .vertical-scroll-container {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            position: relative;
        }

        .pane-content {
            padding: 1rem;
            min-height: 100%;
        }

        .split-handle {
            width: 5px;
            background-color: #f8f9fa;
            cursor: col-resize;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .handle-bar {
            height: 30px;
            width: 3px;
            background-color: #6c757d;
            border-radius: 3px;
        }

        .split-handle:hover {
            background-color: #e9ecef;
        }

        .split-handle:hover .handle-bar {
            background-color: #495057;
        }

        /* 自定义滚动条样式 */
        .vertical-scroll-container::-webkit-scrollbar {
            width: 8px;
        }

        .vertical-scroll-container::-webkit-scrollbar-track {
            background: #f1f1f1;
        }

        .vertical-scroll-container::-webkit-scrollbar-thumb {
            background: #888;
            border-radius: 4px;
        }

        .vertical-scroll-container::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

        /* 工作流和任务卡片样式 */
        .workflow-card, .task-card {
            margin-bottom: 1rem;
            padding: 1rem;
            border: 1px solid #dee2e6;
            border-radius: 0.25rem;
            background-color: #fff;
        }

        .workflow-card:hover, .task-card:hover {
            box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        }

        /* 任务头部样式 */
        .task-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        /* 状态图标样式 */
        .status-icon {
            display: inline-block;
            width: 20px;
            height: 20px;
            text-align: center;
            line-height: 20px;
            border-radius: 50%;
        }

        .status-icon.in-progress {
            color: #007bff;
        }

        .status-icon.completed {
            color: #28a745;
        }

        .status-icon.error {
            color: #dc3545;
        }

        /* 进度条样式 */
        .progress-container {
            display: flex;
            align-items: center;
            margin-top: 10px;
        }

        .progress-bar {
            flex-grow: 1;
            height: 10px;
            background-color: #e9ecef;
            border-radius: 5px;
            overflow: hidden;
            margin-right: 10px;
        }

        .progress-fill {
            height: 100%;
            background-color: #007bff;
            transition: width 0.3s ease;
        }

        .progress-text {
            min-width: 40px;
            text-align: right;
        }

        .terminate-btn {
            padding: 3px 8px;
            background-color: #dc3545;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
            margin-left: 10px;
            transition: background-color 0.2s;
        }

        .terminate-btn:hover {
            background-color: #c82333;
        }

        .terminate-btn:disabled {
            background-color: #6c757d;
            cursor: not-allowed;
        }

        .control-btn {
            padding: 3px 8px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
            margin-left: 10px;
            transition: background-color 0.2s;
        }

        .terminate-btn:hover {
            background-color: #0051ff;
        }

        .terminate-btn:disabled {
            background-color: #6c757d;
            cursor: not-allowed;
        }

        /* 任务状态和操作容器 */
        .task-controls {
            display: flex;
            align-items: center;
        }
    </style>

    <script src="/static/js/running.js"></script>
    
    {{> footer}}
</body>
</html>

